[#ftl]
###${serviceComment}

###标量类型包装
type ${entityType}IntValue{
    value:Int
}
type ${entityType}StringValue{
    value:String
}
type ${entityType}DoubleValue{
    value:Float
}
type ${entityType}BooleanValue{
    value:Boolean
}
type ${entityType}LongValue{
    value:Int
}

#扩展修改结果
type ${entityType}MutationInfo {
    #更新结果状态，是否更新成功
    status:Boolean
    #更新影响数据行数
    rows:Int
    #更新结果反馈信息
    messages:String
    #更新操作唯一标识
    uuid:String
    #数字签名，在有安全需求的情况下启用，用来核对数据的安全性
    sign:String
    #更新时间
    executeTime:Float
    #更新后的对象
    result:${entityType}Entity
    #错误信息
    errorBody:GraphQLErrorBody
}
[#if queryList?size > 0]
    #查询组件
extend type Query {
    [#list queryList as query]
        #${query.comment!}
        ${query.name}[#if query.params?size gt 0]([#list query.params as param]"${param.comment!"未定义"}"${param.name}:${param.type}[/#list])[/#if]:${query.return}
    [/#list]
}
[/#if]
[#if mutationList?size > 0]
    #变更组件
extend type Mutation {
    [#list mutationList as mutation]
        #${mutation.comment!}
        ${mutation.name}[#if mutation.params?size gt 0]([#list mutation.params as param]"${param.comment!"未定义"}"${param.name}:${param.type} [/#list])[/#if]:${entityType}MutationInfo
    [/#list]
}
[/#if]
#查询列表结果
type ${entityType}EntityConnection{
    #查询结果反馈信息
    resultInfo:ResultInfo
    #查询数据
    edges: [${entityType}EntityEdge]
    #分页信息
    pageInfo: PageInfo
    #每次查询的唯一标识
    uuid:String
    #查询总数据量，用于分页
    totalCount:Int
}
#数据对象包装
type ${entityType}EntityEdge{
    #数据
    node: ${entityType}Entity
}
#单个对象或者数据查询结果
type ${entityType}EntityPackage{
    #查询结果反馈信息
    resultInfo:ResultInfo
    #查询数据
    entity: ${entityType}Entity
    #每次查询的唯一标识
    uuid:String
}
[#macro writeFields]
[#list fields as f]
    #${f.comment!}
    ${f.name}:${f.type}
[/#list]
[/#macro]
[#macro writeInputs]
[#list inputs as f]
    #${f.comment!}
    ${f.name}:${f.type}
[/#list]
[/#macro]
[#macro writeFilters]
[#list filters as f]
    #${f.comment!}
    ${f.name}:${f.type}
[/#list]
[/#macro]
[#if support?contains("DISPLAY")]
    #${entityComment}查询结果
type ${entityType}Entity{
    id: ID
    [@writeFields/]
}
[/#if]
[#if support?contains("INPUT")]
    #${entityComment}修改
input ${inputType}Input {
    id: ID
    [@writeInputs/]
}
[/#if]
[#if support?contains("FILTER")]
    #${entityComment}查询条件
input ${entityType}Filter {
    id: stringFilter
    [@writeFilters/]
}
[/#if]
[#list extTypesVo as extType]
    #${extType.comment}
type ${extType.name}Vo{
    [#list extType.fields as f]
        #${f.comment!}
        ${f.name}:${f.type}
    [/#list]
}
[/#list]
[#list extTypesIo as extType]
    #${extType.comment}
input ${extType.name}Io{
    [#list extType.fields as f]
        #${f.comment!}
        ${f.name}:${f.type}
    [/#list]
}
[/#list]
